import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooDataAccessAuthorizationController } from '../../../controllers';
const uctoodataAccessAuthorizationRouter = new Router();
const dataAccessAuthorizationController = new uctooDataAccessAuthorizationController();

uctoodataAccessAuthorizationRouter.post('/add', requireUser, dataAccessAuthorizationController.add);
uctoodataAccessAuthorizationRouter.post('/edit', requireUser, rowLevelPermission('uctoo/data_access_authorization'), dataAccessAuthorizationController.edit);
uctoodataAccessAuthorizationRouter.post('/del', requireUser, rowLevelPermission('uctoo/data_access_authorization'), dataAccessAuthorizationController.delete);

//For getting dataAccessAuthorization with permission control
uctoodataAccessAuthorizationRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/data_access_authorization'), dataAccessAuthorizationController.getSingle);
uctoodataAccessAuthorizationRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/data_access_authorization'), dataAccessAuthorizationController.getMany);
uctoodataAccessAuthorizationRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/data_access_authorization'), dataAccessAuthorizationController.getMany);

//#endregion AutoCreateCode
export default uctoodataAccessAuthorizationRouter;
